﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
//
public class Example2 : MonoBehaviour
{

    public AssetReference prefabRef;


    private IEnumerator Start()
    {
        if (prefabRef != null)
        {
            yield return new WaitForSeconds(0.5f);
            var handle = prefabRef.InstantiateAsync();
            yield return handle;
            yield return new WaitForSeconds(1.5f);
            Addressables.ReleaseInstance(handle);
        }
       
    }

}
